# 5.3后面的动手试一试
# 练习5.3
alien_color = 'green'
if alien_color == 'green':
    print("你获得了5分！")

if alien_color == "red":
    print('你获得了3分！')

# 练习5.7
favorite_fruits = ['watermelon', 'apple', 'orange']
if 'grape' in favorite_fruits:
    print('You really like bananas!')

if 'banana' in favorite_fruits:
    print('You really like bananas!')

# 5.4后面的动手试一试
# 练习5.10
current_users = ['yanGJian', 'BAgujing', 'erlaNShen',
                 'sunwUKong', 'sunwUJing', 'sunwUNeng']
new_users = ['tangseng', 'yangjian', 'sunwukong', 'baigujing', 'niumowang']
for new_user in new_users:
    if new_user in current_users:
        print('此名称已被占用，请输入其它的用户名')
    else:
        print('此名称未被使用')

current_users = ['yanGJian', 'BAgujing', 'erlaNShen',
                 'sunwUKong', 'sunwUJing', 'sunwUNeng']
current_users_copy = []
for current_user in current_users:
    current_users_copy.append(current_user.lower())

new_users = ['tangseng', 'yangjian', 'sunwukong', 'baigujing', 'niumowang']
for new_user in new_users:
    if new_user.lower() in current_users_copy:
        print('此名称已被占用，请输入其它的用户名')
    else:
        print('此名称未被使用')

# 练习5.11
numbers = []
for number in range(1, 10):
    numbers.append(number)

for number in numbers:
    if number == 1:
        print(f'{number}st')
    elif number == 2:
        print(f'{number}nd')
    else:
        print(f'{number}th')
